<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../base.jsp" %>
<style>
	.content-wrapper{margin-left: 0px}
</style>
<body class="hold-transition skin-blue sidebar-mini">

	<div class="wrapper">
		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
			<h1>用户管理<small>用户列表</small></h1>
				<ol class="breadcrumb">
					<li><a href="javascript:;"><i class="fa fa-dashboard"></i> 首页</a></li>
					<li class="active">用户管理</li>
				</ol>
			</section>
			<!-- Main content -->
			<section class="content">
				<div class="row">
				<div class="col-xs-12">
					<div class="box">
						<!-- /.box-header -->
						<div class="box-body table-responsive no-padding">
						<table class="table table-hover">
							<tr>
								<td><a href="${url }permission/user/mergepage" class="btn btn-primary">新增</a></td>
							</tr>
						</table>
						</div>
					</div>
				</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<!-- /.box-header -->
							<div class="box-body table-responsive no-padding">
								<table class="table table-bordered">
									<tr>
										<th>ID</th>
										<th>账号</th>
										<th>姓名</th>
										<th>创建时间</th>
										<th>操作</th>
									</tr>
									<c:forEach items="${list }" var="list">
									<tr>
										<td>${list.id }</td>
										<td>${list.account }</td>
										<td>${list.name }</td>
										<td>${list.addtime }</td>
										<td>
											<a class="fa fa-edit" onclick="edit('${list.id }')">编辑</a> | 
											<a class="fa fa-remove" onclick="del('${list.id }')">删除</a> |
											<a class="fa fa-gears" onclick="set('${list.id }')">分配菜单</a> 
										</td>
									</tr>
									</c:forEach>
								</table>
							</div>
							<!-- /.box-body -->
						</div>
						<!-- /.box -->
					</div>
				</div>
			</section>
		</div>
	</div>
	<script type="text/javascript">
	function edit(id){
		location.href = path+'permission/user/mergepage?id='+id;
	}
	function set(id){
		location.href = path+'permission/user/setMenu?id='+id;
	}
	function del(id){
		layer.confirm('确定删除么?', function(){ 
			$.post(path+'permission/user/del',{id:id},function(data){
				if(data>0){
					layer.msg('删除成功', {
              		  closeBtn: 0
              		}, function(){
              			location.href = path+'permission/user/list';
              		});
				}
			});
		});
	}
	$(function () {
	});
	</script>
</body>